home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / nask15.zip / NASK.DOC next >
Text File  |  1991-06-17  |  4KB  |  100 lines

  1. N-ASK Batch Util   (c) 1990                                                -1-
  2.  
  3.             ___      __           ___       ________   __    ___
  4.            |   \    |  |         / _ \     /  ______| |  |  /  /
  5.            |     \  |  |  __   /  / \  \  (  (_____   |  |/  /
  6.            |  |\   \|  | |__| |  |___|  |  \_____  \  |     <
  7.            |  |  \     |      |   ___   |  ______)  ) |  |\  \
  8.            |__|    \___|      |__|   |__| |________/  |__|  \__\
  9.  
  10.                                  Ver 1.5
  11.  
  12.    This is an interactive question asking program used in BATCH files.  It
  13. is used in the form of:
  14.  
  15.  NASK "<question>",<possible responses> [-B] [-S]
  16.                             [-D=<default answer>] [-?] [-A]
  17.  
  18.    The question is any string of characters (including quotes inside the
  19. delimeters).  The possible responses are all the letters/numbers that may be
  20. used to respond to the question.  These are non-case senstive so you may put
  21. them either in upper or lower case.  The -B option makes the program beep when
  22. a response is entered that is not in the possible answers.  The -S option will
  23. keep the cursor on the same line as the prompted question.  The -D, for default
  24. answer, will return the letter put after the equal sign when you hit enter at
  25. the prompted question.  The short help is availiable with the -? or when N-ASK
  26. is run without any parameters.  The -A function will return the ascii value of
  27. the key pressed for the errorlevel.  This will be demonstrated later.
  28.  
  29.    You can use NASK to write batch menus such as:
  30.  
  31.   ECHO OFF
  32.   ECHO   [A] MYPROG.EXE
  33.   ECHO   [B] BLAH.BAT
  34.   ECHO   [C] WHATEVER.COM
  35.   ECHO   [D] QUIT
  36.   ECHO"
  37.   NASK "Which one do you want? ",ABCD -s -b -d=A
  38.   if errorlevel 4 goto DONE
  39.   if errorlevel 3 goto THIRD
  40.   if errorlevel 2 goto SECOND
  41.   if errorlevel 1 goto FIRST
  42.  
  43.   :FIRST
  44.      MYPROG.EXE
  45.      GOTO DONE
  46.   :SECOND
  47.      CALL BLAH.BAT
  48.      GOTO DONE
  49.   :THIRD
  50.      WHATEVER.COM
  51.      GOTO DONE
  52.  
  53.   :DONE
  54.  
  55.  
  56.    This batch file will echo the availiable options and wait for the user
  57. press one of the keys (A,B,C or D), will stay on the same line as the question
  58. and then will beep if they hit any other's besides those three keys.  If they
  59. hit return, it will use "A" as the answer because it was set to the default.
  60. Then NASK will exit with an exit code relative to the position of the letter
  61. in the choices string.  Remember, in a batch process, errorlevel x means an
  62. exit code of x or HIGHER!  You must do the IF ERRORLEVEL in decending order
  63. to sort out the errorlevels.
  64.  
  65. N-ASK Batch Util   (c) 1990                                                -2-
  66.  
  67.    Another way to use this program is like this:
  68.  
  69.          NASK "Press a Key:" -A
  70.  
  71.     This will print the "Press a Key" message and wait for any key to be
  72. pressed.  Then instead of the errorlevel returned being the position of the
  73. answer in the list you gave before, the errorlevel value is now set to the
  74. ascii value of the key pressed.  In the case of a Function key, things are a
  75. little different.  Lets say for instance that you pressed the F7 key.  The
  76. computer returns a character 0 then a 65.  BUT, 65 is the same as a capital
  77. letter "A" so you have to watch out for these things.
  78.  
  79.  
  80.  
  81. Notes:
  82.  
  83.       o  You may put multiple commands after a single dash like this:
  84.          NASK "What is your answer: ",123 -bsd=1
  85.  
  86.  
  87.  
  88.    This program is ShareWare which means you may freely copy and distribute
  89. this program.  If you like this program and use it often, you should support
  90. the ShareWare concept by sending $5 (make checks and money orders payable
  91. to "Sean Wachob") to:
  92.  
  93.              Sean Wachob
  94.              4226 Colombo Dr.
  95.              San Jose, CA   95130-1111
  96.  
  97.   Comments or suggestions may be sent to this same address and the same for a
  98. catalogue of other of my releases.  Thank you for using NASK and please look
  99. for my future programs.....
  100.